package com.ysz.globalexception.exums;

import com.ysz.globalexception.assertutil.BusinessExceptionAssert;

/**
 * 异常枚举类
 *
 * @author ysz
 * @date 2022/3/2 13:26
 */
public enum ExceptionEnum implements BusinessExceptionAssert {
    ERROR_1(700, "error_1", null),
    ERROR_2(800, "error_2", null),
    ERROR_3(900, "对象不能为空", null);

    private Integer code;
    private String msg;
    private Object data;

    ExceptionEnum(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }

    @Override
    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
